ternary operator

网络  三目运算符; 三元操作符; 三元运算符; 三重操作符; 三元算子

计算机



双语例句

  1. PHP has the ternary operator ( foo? bar: baz) and an enormous ( and unwieldy) list of function names, with all kinds of naming conventions; you'll find Python a lot cleaner.
    PHP使用三元操作符(foo?bar:baz)和冗长的函数名列表,而命名约定更是无所不有;相反,您会发现Python要简洁多了。
  2. This new operator is, in fact, a shortcut notation for the ternary operator.
    这个新操作符实际上是一个三目操作符的便捷记法。
  3. Avoid using the ternary conditional operator.
    避免使用3元条件运算符。
  4. How many times are you using the ternary operator to change the value of a variable if its content is null to assign it some default value?
    你是否经常使用三目操作符来改变一个变量的值?
  5. 3.1.9 Ternary if-else operator
    3.1.9三元if-else运算符
  6. The second occurrence of the name variable is simply omitted and the ternary operator is no more ternary and is shortened to this more concise form.
    name变量的第二次出现被简单的忽略了,三目操作符不再是三目的了,缩短为这种更简明的形式。
  7. Of course, you could use an ordinary if-else statement ( described later), but the ternary operator is much terser.
    当然,也可以换用普通的if-else语句(在后面介绍),但三元运算符更加简洁。